package cn.ivicar.sim.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import cn.ivicar.config.ConfigUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SimProperties {
    private static transient final Logger LOGGER = LoggerFactory.getLogger(SimProperties.class);
    private static Properties properties = new Properties();
    static {
        try {
            InputStream inputStream = ConfigUtil.getConfigReader().getResourceAsStream("/sim.properties");
            properties.load(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
            LOGGER.error(String.format("读取配置文件失败。 ErrorMsg:[%s]", e.getMessage()));
        }
    }

    public static Properties getProperties() {
        return properties;
    }
    
    public static String getWechatNotifyUrl(){
    	return (String) properties.getProperty("wechat_notify_url", "http://apiserver.ivicar.cn/app-ws/wechat");
    }
    
    public static long getOrderTimeOut(){
    	String value = properties.getProperty("order_time_out", (15 * 60 * 1000)+"");
    	return Long.valueOf(value).longValue(); 
    }
    
}
